/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package core.io;

/**
 *
 * @author Dung Pham
 */
public final class ExchangeKeyAttribute {

    private long secretKey = 0;
    private Tea tea;

    public ExchangeKeyAttribute(long key) {
        this.secretKey = key;
        this.tea = new Tea(key);
    }

    public ExchangeKeyAttribute() {
        this.secretKey = System.currentTimeMillis();
    }

    /**
     * Get a secret key from client key and server key.
     *
     * @return A secret key.
     */
    public long getSecretKey() {
        return this.secretKey;
    }

    /**
     * Get tea cryptography.
     *
     * @return Tea instance.
     */
    public Tea getTea() {
        return this.tea;
    }

    /**
     * Set secret key
     *
     * @param key Key.
     */
    public void setSecretKey(long key) {
        this.secretKey = key;
        this.tea = new Tea(key);
    }
}
